package com.tiger.test 
{
	import com.tiger.mgr.ResMgr;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.events.Event;
	
	/**
	 * ...
	 * @author wmTiger
	 */
	public class TestLoad extends Sprite 
	{
		
		public function TestLoad():void 
		{
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
		}
		
		private function init(e:Event = null):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			// entry point
			
			var url:String = "1001.swf";
			var url2:String = "1002.swf";
			var swf:MovieClip = ResMgr.instance.getSwf(url);
			if (swf == null) 
			{
				ResMgr.instance.loadSwf(url, url, function ():void 
				{
					trace("loadSwf 1001.swf");
					var ref:Class = ResMgr.instance.getClss(url, "Test");
					trace("ref",ref);
					if (ref) 
					{
						var mc:Sprite = new ref()
						addChild(mc);
					}
				});
				ResMgr.instance.loadSwf(url2, url2, function ():void 
				{
					trace("loadSwf 1002.swf");
					var ref1:Class = ResMgr.instance.getClss(url, "Test");
					trace("ref", ref1);
					if (ref1) 
					{
						var mc:Sprite = new ref1()
						addChild(mc);
						mc.x = 200;
						mc.y = 200;
					}
				});
			}
			else
			{
				
			}
		}
		
	}

}